import { BasicColumn } from '@/components/Table';
import { FormSchema } from '@/components/Table';

export const columns: BasicColumn[] = [
  {
    title: 'index',
    align: 'center',
    dataIndex: 'index',
    width: 200,
  },
  {
    title: '名称',
    align: 'center',
    dataIndex: 'name',
  },
  {
    title: '编码',
    align: 'center',
    dataIndex: 'code',
  },
  {
    title: '值',
    align: 'center',
    dataIndex: 'value',
  },
  {
    title: '是否是系统参数',
    align: 'center',
    dataIndex: 'sysFlagStr',
  },
  {
    title: '备注',
    align: 'center',
    dataIndex: 'remark',
  },
  {
    title: '状态',
    align: 'center',
    dataIndex: 'statusStr',
  },
  {
    title: '常量所属分类',
    align: 'center',
    dataIndex: 'groupCode',
  },
  {
    title: '创建时间',
    align: 'center',
    dataIndex: 'createTime',
  },
  {
    title: '创建用户',
    align: 'center',
    dataIndex: 'createUserStr',
  },
  {
    title: '更新时间',
    align: 'center',
    dataIndex: 'updateTime',
  },
  {
    title: '修改用户',
    align: 'center',
    dataIndex: 'updateUserStr',
  },
];

export const searchFormSchema: FormSchema[] = [
  {
    field: 'name',
    label: '名称',
    component: 'Input',
    required: false,
  },
];

export const formSchema: FormSchema[] = [
  {
    field: 'id',
    label: '',
    component: 'Input',
    show: false,
  },
  {
    field: 'name',
    label: '名称',
    component: 'Input',
    required: true,
  },
  {
    field: 'code',
    label: '编码',
    component: 'Input',
    required: true,
  },
  {
    field: 'value',
    label: '值',
    component: 'Input',
    required: true,
  },
  {
    field: 'sysFlag',
    label: '是否系统参数',
    component: 'ApiSelect',
    defaultValue: 'N',
    componentProps: {
      dictCode: 'yes_or_no',
    },
    required: true,
  },
  {
    field: 'remark',
    label: '备注',
    component: 'InputTextArea',
    required: true,
  },
  {
    field: 'status',
    label: '状态',
    component: 'ApiSelect',
    defaultValue: '0',
    componentProps: {
      dictCode: 'common_status',
    },
    required: true,
  },
  {
    field: 'groupCode',
    label: '常量所属分类',
    component: 'Input',
    required: true,
  },
];
